package com.yulinlin.jdbc.mysql;

import com.yulinlin.core.IWrapperManager;
import com.yulinlin.core.wrapper.IDeleteWrapper;
import com.yulinlin.core.wrapper.IInsertWrapper;
import com.yulinlin.core.wrapper.ISelectWrapper;
import com.yulinlin.core.wrapper.IUpdateWrapper;
import com.yulinlin.jdbc.mysql.MysqlDeleteWrapper;
import com.yulinlin.jdbc.mysql.MysqlInsertWrapper;
import com.yulinlin.jdbc.mysql.MysqlSelectWrapper;
import com.yulinlin.jdbc.mysql.MysqlUpdateWrapper;


public class MysqlWrapperManager implements IWrapperManager {

    @Override
    public <E, R> ISelectWrapper<E, R> ofSelect() {
        return ofSelect(null);
    }

    @Override
    public <E, R> IUpdateWrapper<E, R> ofUpdate() {
        return ofUpdate(null);
    }

    @Override
    public <E, R> IDeleteWrapper<E, R> ofDelete() {
        return ofDelete(null);
    }

    public <E,R> ISelectWrapper<E,R> ofSelect(R endWrapper){
        return  new MysqlSelectWrapper(endWrapper);
    }

    public IInsertWrapper ofInsert(){
        return  new MysqlInsertWrapper();
    }

    public <E,R> IUpdateWrapper<E,R> ofUpdate(R endWrapper){
        return  new MysqlUpdateWrapper(endWrapper);
    }

    public <E,R> IDeleteWrapper<E,R> ofDelete(R endWrapper){
        return  new MysqlDeleteWrapper(endWrapper);
    }
}
